package me.huanmeng.heater.socket;

import org.json.JSONObject;

/**
 * 2021/9/26<br>
 * Heater<br>
 *
 * @author huanmeng_qwq
 */
public class HeartBeatPacket {
    private final BotSocketClient botSocketClient;

    public HeartBeatPacket(BotSocketClient botSocketClient) {
        this.botSocketClient = botSocketClient;
    }

    public void send() {
        if (!botSocketClient.isOpen()) {
            return;
        }
        botSocketClient.send(new JSONObject()
                .put("s", 2)
                .put("sn", botSocketClient.getSocketMain().getSn())
                .toString()
        );
    }
}
